<?php


class Tour_SearchController extends Zend_Controller_Action
{

    public function init()
    {
        $this->params = $this->getRequest()->getParams();
        System_Template::using("search","Default");
        $this->model = new Tour_Model_Tour();
        parent::init();
    }

    public function indexAction()
    {
        $table = new System_Table_Category();
        $tableCity = new System_Table_City();
        $this->view->listCity = $tableCity->fetchAll();
        $this->view->listTourType = $table->fetchAll();
        $count = $this->model->countSearchList($this->params);
        $lastPage = ceil($count/10);
        $this->view->lastPage = $lastPage;
        $pageCurrent = $this->params['page'];
        $data = $this->model->search($pageCurrent,$this->params);
        $this->view->data = $data;
        $this->view->params = $this->params;
    }


}

